const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const path = require('path');



module.exports = merge(common, {
    mode: 'development',
    devtool: 'cheap-module-source-map',
    entry: './src/main.js',
    output: {
        filename: 'bundle.js',
        publicPath: '/', // 改为根路径（避免资源加载问题）
    },
    devServer: {
        static: {
            directory: path.join(__dirname, 'dev-dist'), // 静态文件目录
        },
        hot: true, // 启用热更新
        host: '127.0.0.1',
        port: 3000,
        open: true,
    },
});
